home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LT_Refresh.c < prev    next >
C/C++ Source or Header  |  1996-08-28  |  5KB  |  203 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. /****** gtlayout.library/LT_BeginRefresh ******************************************
  15. *
  16. *   NAME
  17. *    LT_BeginRefresh -- Optimized window refreshing
  18. *
  19. *   SYNOPSIS
  20. *    LT_BeginRefresh(Handle)
  21. *                      A0
  22. *
  23. *   FUNCTION
  24. *    If you wish to handle window refreshing all on your own, you
  25. *    might want to use the LT_BeginRefresh...LT_EndRefresh pair
  26. *    in your program. By default the user interface layout engine
  27. *    will automatically intercept IDCMP_REFRESHWINDOW events and
  28. *    react to them accordingly.
  29. *
  30. *   INPUTS
  31. *    Handle - Pointer to a LayoutHandle structure.
  32. *
  33. *   RESULT
  34. *    none
  35. *
  36. *   SEE ALSO
  37. *    intuition.library/BeginRefresh
  38. *    intuition.library/EndRefresh
  39. *    gtlayout.library/LT_EndRefresh
  40. *
  41. ******************************************************************************
  42. *
  43. */
  44.  
  45. VOID LIBENT
  46. LT_BeginRefresh(REG(a0) LayoutHandle *handle)
  47. {
  48.     if(handle)
  49.     {
  50.         GT_BeginRefresh(handle->Window);
  51.  
  52.         LTP_DrawGroup(handle,handle->TopGroup);
  53.     }
  54. }
  55.  
  56.  
  57. /*****************************************************************************/
  58.  
  59.  
  60. /****** gtlayout.library/LT_EndRefresh ******************************************
  61. *
  62. *   NAME
  63. *    LT_EndRefresh -- Optimized window refreshing
  64. *
  65. *   SYNOPSIS
  66. *    LT_EndRefresh(Handle)
  67. *                    A0
  68. *
  69. *    VOID LT_EndRefresh(LayoutHandle *);
  70. *
  71. *   FUNCTION
  72. *    If you wish to handle window refreshing all on your own, you
  73. *    might want to use the LT_BeginRefresh...LT_EndRefresh pair
  74. *    in your program. By default the user interface layout engine
  75. *    will automatically intercept IDCMP_REFRESHWINDOW events and
  76. *    react to them accordingly.
  77. *
  78. *   INPUTS
  79. *    Handle - Pointer to a LayoutHandle structure.
  80. *
  81. *   RESULT
  82. *    none
  83. *
  84. *   SEE ALSO
  85. *    gtlayout.library/LT_BeginRefresh
  86. *    intuition.library/BeginRefresh
  87. *    intuition.library/EndRefresh
  88. *
  89. ******************************************************************************
  90. *
  91. */
  92.  
  93. VOID LIBENT
  94. LT_EndRefresh(REG(a0) LayoutHandle *handle,REG(d0) BOOL complete)
  95. {
  96.     if(handle)
  97.         GT_EndRefresh(handle->Window,complete);
  98. }
  99.  
  100. /****** gtlayout.library/LT_Refresh *****************************************
  101. *
  102. *   NAME
  103. *    LT_Refresh -- Redraws the entire window contents.
  104. *
  105. *   SYNOPSIS
  106. *    LT_Refresh(Handle)
  107. *                 A0
  108. *
  109. *    VOID LT_Refresh(LayoutHandle *);
  110. *
  111. *   FUNCTION
  112. *    Redraws the contents of the window, this includes both gadgets
  113. *    and imagery.
  114. *
  115. *   INPUTS
  116. *    Handle - Pointer to a LayoutHandle structure.
  117. *
  118. *   RESULT
  119. *    none
  120. *
  121. *   SEE ALSO
  122. *       gadtools.library/GT_RefreshWindow
  123. *       intuition.library/RefreshGList
  124. *
  125. ******************************************************************************
  126. *
  127. */
  128.  
  129. VOID LIBENT
  130. LT_Refresh(REG(a0) LayoutHandle *handle)
  131. {
  132.     if(handle)
  133.     {
  134. #ifdef DO_BOOPSI_KIND
  135.         if(handle->BOOPSIList)
  136.             RefreshGList((struct Gadget *)handle->BOOPSIList,handle->Window,NULL,(UWORD)-1);
  137. #endif    /* DO_BOOPSI_KIND */
  138.  
  139.         RefreshGList(handle->List,handle->Window,NULL,(UWORD)-1);
  140.  
  141.         GT_RefreshWindow(handle -> Window,NULL);
  142.  
  143.         LTP_DrawGroup(handle,handle -> TopGroup);
  144.     }
  145. }
  146.  
  147. /****** gtlayout.library/LT_CatchUpRefresh **************************************
  148. *
  149. *   NAME
  150. *    LT_CatchUpRefresh -- Repair the display after missing the
  151. *                         Window refresh message (V34).
  152. *
  153. *   SYNOPSIS
  154. *    LT_CatchUpRefresh(Handle)
  155. *                        A0
  156. *
  157. *    VOID LT_CatchUpRefresh(LayoutHandle *);
  158. *
  159. *   FUNCTION
  160. *    In case an application missed an IDCMP_REFRESHWINDOW event
  161. *    the display may be damaged and in need of repair. This can
  162. *    happen if the ASL requester is attached to the window,
  163. *    sharing its IDCMP with the Window. Any refresh events will then
  164. *    go straight to nil. Call this routine if you believe that
  165. *    you missed a refresh event. The display will be repaired only
  166. *    if it is in need of repair, so there is no harm in calling it
  167. *    if not actually necessary.
  168. *
  169. *   INPUTS
  170. *    Handle - Pointer to a LayoutHandle structure.
  171. *
  172. *   RESULT
  173. *    none
  174. *
  175. *   SEE ALSO
  176. *    gtlayout.library/LT_BeginRefresh
  177. *    intuition.library/BeginRefresh
  178. *    intuition.library/EndRefresh
  179. *
  180. ******************************************************************************
  181. *
  182. */
  183.  
  184. VOID LIBENT
  185. LT_CatchUpRefresh(REG(a0) LayoutHandle *handle)
  186. {
  187.     if(handle)
  188.     {
  189.             /* Do we have damage? */
  190.  
  191.         if(handle->Window->WLayer->Flags & LAYERREFRESH)
  192.         {
  193.                 /* Do the usual bit. */
  194.  
  195.             GT_BeginRefresh(handle->Window);
  196.  
  197.             LTP_DrawGroup(handle,handle->TopGroup);
  198.  
  199.             GT_EndRefresh(handle->Window,TRUE);
  200.         }
  201.     }
  202. }
  203.